Trees | Indices | Toggle frames |
---|
Application-wide functionality.
Most applications need only call run after creating one or more windows to begin processing events. For example, a simple application consisting of one window is:
from pyglet import app from pyglet import window win = window.Window() app.run()
To handle events on the main event loop, instantiate it manually. The following example exits the application as soon as any window is closed (the default policy is to wait until all windows are closed):
event_loop = app.EventLoop() @event_loop.event def on_window_close(window): event_loop.exit()
Since: pyglet 1.1
WeakSet
Set of objects, referenced weakly.
|
|
EventLoop
The main run loop of the application.
|
run()
Begin processing events, scheduled functions and window updates.
|
|
exit()
Exit the application event loop.
|
displays = WeakSet()
|
|
windows = WeakSet()
|
|
event_loop = None
|
|
__package__ =
|
Begin processing events, scheduled functions and window updates.
This is a convenience function, equivalent to:
EventLoop().run()
Exit the application event loop.
Causes the application event loop to finish, if an event loop is currently running. The application may not necessarily exit (for example, there may be additional code following the run invocation).
This is a convenience function, equivalent to:
event_loop.exit()
Trees | Indices | Toggle frames |
---|
Generated by Epydoc 3.0beta1 on Thu Dec 31 17:58:17 2009 | http://epydoc.sourceforge.net |